/*
 * User: Sebastian Schuth <sebastian.schuth@agimatec.de>
 * Date: 29.10.2008
 * Time: 12:00:39
 * Copyright (c) 2008 agimatec GmbH
 */
package com.agimatec.locators.predicate;

/**
 * Selector predicate that tests a node's "class" attribute
 * to contain the given css class name.
 */
public class CssClass extends Predicate {
    private String clazzName;

    /**
     * Constructor.
     *
     * @param className The css class name to look for.
     */
    public CssClass(String className) {
        this.clazzName = className;
    }

    public String locatorPartString(LocatorStringFactory factory) {
        return factory.getCssClassPredicate(clazzName).locatorString();
    }
}
